import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;

public class PrintWriterDemo17 {
    public static void main(String[] args) throws FileNotFoundException {
//        FileOutputStream fileOutputStream = new FileOutputStream("F:\\IdeaProjects\\MyJava230203\\day27\\dir\\1.log");
//        PrintStream printStream = new PrintStream(fileOutputStream);
//        printStream.println("哈哈");
//        printStream.close();

        FileOutputStream fileOutputStream = new FileOutputStream("F:\\IdeaProjects\\MyJava230203\\day27\\dir\\2.log");
        PrintStream printStream = new PrintStream(fileOutputStream);
        System.setOut(printStream);
        System.out.println(1);
        System.out.println("haha");
        System.out.println("333");
    }
}
